home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / net / readline-2.0mg.tar.gz / readline-2.0mg.tar / readline-2.0mg / Makefile.in < prev    next >
Makefile  |  1995-04-17  |  6KB  |  207 lines

  1. # Master Makefile for the GNU readline library.
  2. # Copyright (C) 1994 Free Software Foundation, Inc.
  3.  
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8.  
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. srcdir = @srcdir@
  19. VPATH = @srcdir@
  20.  
  21. prefix = /usr/local
  22. exec_prefix = $(prefix)
  23. bindir = $(exec_prefix)/bin
  24. libdir = $(exec_prefix)/lib
  25. incdir = $(exec_prefix)/include
  26. mandir = $(prefix)/man/man1
  27.  
  28. SHELL = /bin/sh
  29.  
  30. INSTALL = @INSTALL@
  31. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  32. INSTALL_DATA = @INSTALL_DATA@
  33.  
  34. RANLIB = @RANLIB@
  35. AR = ar
  36. RM = rm
  37. CP = cp
  38. MV = mv
  39.  
  40. DEFS = @DEFS@
  41. CFLAGS = -g
  42. LDFLAGS = -g
  43.  
  44. # For libraries which include headers from other libraries.
  45. INCLUDES = -I. -I$(srcdir)
  46.  
  47. CPPFLAGS = $(DEFS) $(INCLUDES)
  48.  
  49. PICFLAG=        -pic    # -fpic for some versions of gcc
  50. SHLIB_OPTS=    -assert pure-text -ldl    # -Bshareable for some versions of gcc
  51. MAJOR=        2
  52. MINOR=        .0
  53.  
  54. .SUFFIXES:    .so
  55. .c.o:
  56.     $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
  57.  
  58. .c.so:
  59.     -mv $*.o z$*.o
  60.     $(CC) -c $(PICFLAG) $(CPPFLAGS) $(CFLAGS) $< 
  61.     mv $*.o $@
  62.     -mv z$*.o $*.o
  63.  
  64. # The name of the main library target.
  65. LIBRARY_NAME = libreadline.a
  66. SHARED_READLINE = libreadline.so.$(MAJOR)$(MINOR)
  67. SHARED_HISTORY = libhistory.so.$(MAJOR)$(MINOR)
  68. SHARED_LIBS = $(SHARED_READLINE) $(SHARED_HISTORY)
  69.  
  70. # The C code source files for this library.
  71. CSOURCES = $(srcdir)readline.c $(srcdir)funmap.c $(srcdir)keymaps.c \
  72.        $(srcdir)vi_mode.c $(srcdir)parens.c $(srcdir)rltty.c \
  73.        $(srcdir)complete.c $(srcdir)bind.c $(srcdir)isearch.c \
  74.        $(srcdir)display.c $(srcdir)signals.c $(srcdir)emacs_keymap.c \
  75.        $(srcdir)vi_keymap.c $(srcdir)history.c $(srcdir)tilde.c \
  76.        $(srcdir)xmalloc.c
  77.  
  78. # The header files for this library.
  79. HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h \
  80.        posixstat.h tilde.h rlconf.h
  81.  
  82. INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h
  83.  
  84. OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
  85.       rltty.o complete.o bind.o isearch.o display.o signals.o \
  86.       history.o tilde.o xmalloc.o
  87.  
  88. SHARED_OBJ = readline.so vi_mode.so funmap.so keymaps.so parens.so search.so \
  89.       rltty.so complete.so bind.so isearch.so display.so signals.so \
  90.       history.so tilde.so xmalloc.so
  91.  
  92. # The texinfo files which document this library.
  93. DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
  94. DOCOBJECT = doc/readline.dvi
  95. DOCSUPPORT = doc/Makefile
  96. DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
  97.  
  98. SUPPORT = Makefile ChangeLog $(DOCSUPPORT) examples/[-a-z.]*
  99.  
  100. SOURCES  = $(CSOURCES) $(HSOURCES) $(DOCSOURCE)
  101.  
  102. THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
  103.  
  104. ##########################################################################
  105.  
  106. all: libreadline.a libhistory.a
  107. shared: $(SHARED_LIBS)
  108.  
  109. libreadline.a: $(OBJECTS)
  110.     $(RM) -f $@
  111.     $(AR) cq $@ $(OBJECTS)
  112.     -$(RANLIB) $@
  113.  
  114. libhistory.a: history.o
  115.     $(RM) -f $@
  116.     $(AR) cq $@ history.o
  117.     -$(RANLIB) $@
  118.  
  119. $(SHARED_READLINE):    $(SHARED_OBJ)
  120.     $(RM) -f $@
  121.     ld ${SHLIB_OPTS} -o $@ $(SHARED_OBJ)
  122.  
  123. $(SHARED_HISTORY):    history.so
  124.     $(RM) -f $@
  125.     ld ${SHLIB_OPTS} -o $@ history.so
  126.  
  127. documentation: force
  128.     [ -d doc ] || mkdir doc
  129.     ( cd doc; $(MAKE) $(MFLAGS) )
  130.  
  131. force:
  132.  
  133. install: installdirs libreadline.a
  134.     $(INSTALL_DATA) $(INSTALLED_HEADERS) $(incdir)/readline
  135.     -$(MV) $(libdir)/libreadline.a $(libdir)/libreadline.old
  136.     $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
  137.     -$(RANLIB) -t $(libdir)/libreadline.a
  138.  
  139. installdirs:
  140.     [ -d $(incdir)/readline ] || mkdir $(incdir)/readline
  141.     -chmod 755 $(incdir)/readline
  142.     [ -d $(libdir) ] || mkdir $(libdir)
  143.  
  144. uninstall:
  145.     [ -n "$(incdir)" ] && cd $(incdir)/readline && \
  146.         ${RM} -f ${INSTALLED_HEADERS}
  147.     [ -n "$(libdir)" ] && cd $(libdir) && \
  148.         ${RM} -f libreadline.a libreadline.old $(SHARED_LIBS)
  149.  
  150. clean::
  151.     rm -f $(OBJECTS) *.a $(SHARED_OBJ) $(SHARED_LIBS)
  152.     (if [ -d doc ]; then cd doc; $(MAKE) $(MFLAGS) $@; fi)
  153.  
  154. readline: readline.h rldefs.h chardefs.h
  155. readline: $(OBJECTS)
  156.     $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
  157.       $(LOCAL_INCLUDES) -DTEST -o readline readline.c vi_mode.o funmap.o \
  158.       keymaps.o -ltermcap
  159.  
  160. info:
  161. install-info:
  162. dvi:
  163. check:
  164. installcheck:
  165.  
  166. tags:    force
  167.     etags $(CSOURCES) $(HSOURCES)
  168.  
  169. TAGS:    force
  170.     ctags -x $(CSOURCES) $(HSOURCES) > $@
  171.  
  172. Makefile: config.status $(srcdir)/Makefile.in
  173.     $(SHELL) config.status
  174.  
  175. config.status: configure
  176.     $(SHELL) config.status --recheck
  177.  
  178. configure: configure.in            ## Comment-me-out in distribution
  179.     cd $(srcdir); autoconf     ## Comment-me-out in distribution
  180. config.h.in: configure.in          ## Comment-me-out in distribution
  181.     cd $(srcdir); autoheader   ## Comment-me-out in distribution
  182.  
  183. mostlyclean: clean
  184.  
  185. distclean realclean: clean
  186.     rm -f Makefile config.status config.h stamp-config
  187.  
  188. # Tell versions [3.59,3.63) of GNU make not to export all variables.
  189. # Otherwise a system limit (for SysV at least) may be exceeded.
  190. .NOEXPORT:
  191.  
  192. # Dependencies
  193. readline.o: readline.c readline.h rldefs.h rlconf.h chardefs.h
  194. readline.o: keymaps.h history.h
  195. vi_mode.o:  rldefs.h rlconf.h readline.h history.h
  196. funmap.o:   funmap.c readline.h rlconf.h
  197. keymaps.o:  keymaps.c emacs_keymap.c vi_keymap.c keymaps.h chardefs.h rlconf.h
  198. history.o: history.h memalloc.h
  199. isearch.o: memalloc.h readline.h history.h
  200. search.o: memalloc.h readline.h history.h
  201. display.o: readline.h history.h rldefs.h rlconf.h
  202. complete.o: readline.h rldefs.h rlconf.h
  203. rltty.o: rldefs.h rlconf.h readline.h
  204. bind.o: rldefs.h rlconf.h readline.h history.h
  205. signals.o: rldefs.h rlconf.h readline.h history.h
  206. parens.o: readline.h
  207.